﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Layouts/Monoblock.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="ScrumBox.Web.Views.Project.List" %>
<%@ Import Namespace="ScrumBox.Web.Controllers"%>
<%@ Import Namespace="ScrumBox.Model"%>
<%@ Import Namespace="MvcContrib"%>

<asp:Content ID="content" ContentPlaceHolderID="MainContent" runat="server">
<% if(ViewData.Get<IList<Project>>().Count > 0) { %> 
    <h2 class="title">Projects:</h2>
    <div class="entry">
        <table id="projects" cellspacing="0">
            <tr>
                <th>Name</th>
                <th>Description</th>
                <th>Key</th>
                <th>Start Date</th>
                <th></th>
            </tr>
            
            <% foreach (var project in ViewData.Get<IList<Project>>())
               {%>
            <tr>
                <td><%= Html.ActionLink<ProjectController>(c => c.Details(project.Key), project.Name) %></td>
                <td><%= project.Description %></td>
                <td><%= project.Key %></td>
                <td><%= project.StartDate %></td>
                <td><%= Html.ActionLink<ProjectController>(c => c.Edit(project.Key), "Edit")%></td>
            </tr>
            <% } %>        
        </table>
        
        <br />
        <div>                
            <%= Html.ActionLink<ProjectController>(c => c.New(), "Create New >>")%>    
        </div>
                
    </div>
<% } %>        
</asp:Content>